package com.pipayshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pipayshop.domain.ShopCommodity;
import com.pipayshop.domain.dto.ShopCommodityDto;
import com.pipayshop.domain.vo.ShopCommodityVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author xiaoqiu
 * @date 2024/9/10 11:13
 * @description
 */
@Mapper
public interface OnlineStoreShopCommodityMapper extends BaseMapper<ShopCommodity> {
    /**
     * 根据条件查询商品总数
     * @param shopCommodityDto 商品查询实体类
     * @return
     */
    List<ShopCommodityVo> select(ShopCommodityDto shopCommodityDto);


//    List<ShopCommodityMinVo> getShopCommodityInfo(String shopId, Integer isDesc, Integer page, Integer limit);

    /**
     * 根据购买数量、商品id =》商品库存复原
     */
    int addStock(@Param("num")Integer num,@Param("commodityId")String commodityId);

    Integer selectPiShoper(String shopId);

    ShopCommodity itemCommodityDetail(String commodityId);

    int reduceStock(@Param("number") Integer number,@Param("commodityId") String commodityId);

//    Long selectAllCollectProductByUserId(String userId);
//
//    List<ShopCommodityCollectionVo> selectCollectProductByUserId(@Param("page") Integer page, @Param("limit") Integer limit,@Param("userId") String userId);
}
